home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / FileOpen.au3 < prev    next >
Text File  |  2007-09-08  |  429b  |  20 lines

  1. $file = FileOpen("test.txt", 0)
  2.  
  3. ; Check if file opened for reading OK
  4. If $file = -1 Then
  5.     MsgBox(0, "Error", "Unable to open file.")
  6.     Exit
  7. EndIf
  8.  
  9. FileClose($file)
  10.  
  11.  
  12. ; Another sample which automatically creates the directory structure
  13. $file = FileOpen("test.txt", 10) ; which is similar to 2 + 8 (erase + create dir)
  14.  
  15. If $file = -1 Then
  16.     MsgBox(0, "Error", "Unable to open file.")
  17.     Exit
  18. EndIf
  19.  
  20. FileClose($file)